package com.example.haoqisystem.respository;

import com.example.haoqisystem.entity.Worker;
import org.apache.catalina.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface WorkerRespository extends JpaRepository<Worker,Long>, JpaSpecificationExecutor<Worker> {
    Optional<Worker> findByAccountAndDeletedFalse(String account);

    Optional<Worker> findByAccountAndRoleAndRoleIdAndDeletedFalse(String account, String role, Integer roleId);

    Optional<Worker> findByIdAndDeletedFalse(Long id);
}
